package com.zyw.customcalendar.operation;

import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Paint.Style;

public class CalendarPaint {

	/*
	 * 1:����weeks�ı߿���ɫ������ɫ
	 * 2:����days�ı߿���ɫ������ɫ��ѡ�б���ɫ
	 * 3:����weeks��������ɫ
	 * 4:����days����������ɫ��ũ��������ɫ������������ɫ
	 * */
	
	private final String yearFontColor = "#FFFFFF";
	private final String yearBgColor = "#FF3030";
	
	private final String weeksBdColor = "#FF3030";
	private final String weeksBgColor = "#FF3030";
	private final String weeksFontColor = "#FFFFFF";
	private float weeksFontSize = 25.0f;
	
	protected float weekGzWidth = -1;
	protected float weekGzHeight = 40;
	
	private String eventsBdColor = "#aaaaaa";
	private String daysBgColor = "#FFFFFF";
	private String daysSelectColor = "#B8B8B8";
	private String daysCurrentColor = "#ff0f0f";
	private String daysCFontColor = "#FFFFFF";
	private String daysGlFontColor = "#000000";
	private String daysNlFontColor = "#CDC0B0";
	private String daysJrFontColor = "";
	private float daysGlFontSize = 20.0f;
	private float daysNlFontSize = 20.0f;
	
	public float dayGzHeight = 50;
	
	protected float yearGzHeight = 50;
	protected float yearGlFontSize = 20.0f;
	
	public float allGdHeight = 0;
	
	public Paint returnYearBgPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(yearBgColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(5.0f);
		return paint;
	}
	
	public Paint returnYearFontPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(Color.parseColor(yearFontColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(1.0f);
		paint.setTextSize(yearGlFontSize);
		paint.setTextAlign(Paint.Align.CENTER);
		return paint;
	}
	
	public Paint returnWeeksBdPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(weeksBdColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(1.0f);
		return paint;
	}
	
	public Paint returnWeeksBgPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(weeksBgColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(5.0f);
		return paint;
	}
	
	public Paint returnWeeksFontPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(Color.parseColor(weeksFontColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(1.0f);
		paint.setTextSize(weeksFontSize);
		paint.setTextAlign(Paint.Align.CENTER);
		return paint;
	}
	
	public Paint returnDaysBgPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(daysBgColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(5.0f);
		return paint;
	}
	
	public Paint returnDaysGLFontPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(Color.parseColor(daysGlFontColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(1.0f);
		paint.setTextSize(daysGlFontSize);
		paint.setTextAlign(Paint.Align.CENTER);
		return paint;
	}
	
	public Paint returnDaysNLFontPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(Color.parseColor(daysNlFontColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(1.0f);
		paint.setTextSize(daysNlFontSize);
		paint.setTextAlign(Paint.Align.CENTER);
		return paint;
	}
	
	public Paint returnCFontPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(Color.parseColor(daysCFontColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(1.0f);
		paint.setTextSize(daysGlFontSize);
		paint.setTextAlign(Paint.Align.CENTER);
		return paint;
	}
	
	public Paint returnDaysSBgPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(daysSelectColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(5.0f);
		paint.setAlpha(50);				//����Ϊ��͸��
		return paint;
	}
	
	public Paint returnDaysCBgPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(daysCurrentColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(5.0f);
		return paint;
	}
	
	public Paint returnEventsBdPaint(){
		Paint paint = new Paint();
		paint.setAntiAlias(false);
		paint.setColor(Color.parseColor(eventsBdColor));
		paint.setStyle(Style.FILL);
		paint.setStrokeWidth(5.0f);
		return paint;
	}
	
	public void setWeekGzWH(int width){
		weekGzWidth = (float) (width / 7.0);
		weekGzHeight = (float) (weekGzWidth / 2.0);
		dayGzHeight = (float)(weekGzWidth * 1.2);
		
		weeksFontSize = (float) (weekGzHeight * 0.6);
		daysGlFontSize = (float) (weekGzHeight * 0.7);
		
		yearGzHeight = (float) (weekGzWidth * 0.8);
		yearGlFontSize = (float) (weekGzHeight * 0.8); 
		daysNlFontSize = (float) (daysGlFontSize * 0.6);
	}

}
